﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace zielonka.co.uk.extensions.system
{
    //Returns the fiscal year for the passed in date

    public static partial class DateTimeExtensions
    {
        /// <summary>
        /// Returns the fiscal year for the passed in date
        /// </summary>
        /// <param name="value">the date</param>
        /// <returns>the fiscal year</returns>
        public static int FiscalYear(this DateTime value)
        {
            int ret = value.Year;
            if (value.Month >= 7) ret++;
            return ret;
        }
    }
}
